<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
<div class="layuimini-container">
    <form id="app-form" class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">用户id</label>
            <div class="layui-input-block">
                <!--                data-open="user.user/sel"-->
                <input type="text" name="user_id" class="layui-input" data-open="user.user/sel" lay-verify="required" placeholder="请输入用户id" value="" autocomplete="off" id="user_id">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">活动名称</label>
            <div class="layui-input-block">
                <input type="text" name="activity_name" class="layui-input" lay-verify="required" placeholder="请输入活动名称" value="" autocomplete="off">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">活动时间</label>
            <div class="layui-input-block">
                <input type="text" name="activity_time"  data-date="" data-date-type="datetime" class="layui-input" lay-verify="required" placeholder="请输入活动时间" autocomplete="off" value="">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">订单号/活动号</label>
            <div class="layui-input-block">
                <input type="text" name="order_id" class="layui-input" lay-verify="required" placeholder="请输入订单号/活动号" autocomplete="off" value="">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">活动类型</label>
            <div class="layui-input-block">
                <input type="text" name="activity_type" class="layui-input" lay-verify="required" data-open="activity.message/type" placeholder="请输入活动类型" autocomplete="off" value="" id="activity_type">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">信息推送状态:</label>
            <div class="layui-input-block">
                <input type="text" name="staus" class="layui-input"  lay-verify="required"   placeholder="请输入信息推送状态 1:已读 0:未读 2:发送失败" autocomplete="off" value="0">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">活动/商品/消息的简介</label>
            <div class="layui-input-block">
                <input type="text" name="desc" class="layui-input" lay-verify="required" placeholder="请输入活动/商品/消息的简介" autocomplete="off" value="">
            </div>
        </div>
        <div class="hr-line"></div>
        <div class="layui-form-item text-center">
            <button class="layui-btn" lay-submit  lay-filter="formDemo" type="button">立即提交</button>
            <button type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="send()" >发送信息</button>
        </div>
    </form>
</div>
<script>
    function getUserIds(id){
        $('#user_id').val(id)
        // var ids=$('#user_id').val()
    }
    function getType(id){
        $('#activity_type').val(id)
        // var ids=$('#activity_type').val()
    }
    function send(){
        var user_id=$('#user_id').val()
        $.ajax({
            url:'/api/send_message',
            method:'post',
            data:{touser:1},
            success:function (res){
                console.log('success')
            }
        })
    }
</script>



